<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>小店页</title>
<link href="/css/base.css" type="text/css" rel="stylesheet" />
<link href="/css/manage.css" type="text/css" rel="stylesheet" />
<link href="/css/layout.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/xiaodian.js"></script>
<script type="text/javascript" src="/js/jquery.default.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>

<script type="text/javascript" src="/js/show_more.js"></script>
<!--[if ie]><link href="/css/ie.css" type="text/css" rel="stylesheet"><![endif]-->
<script type="text/javascript">
$(function(){
	$.defaults.lbShow({
		picUL:"picUL",
		titleUL:"titleUL",
		numsUL:"sPicUL",
		styles:"hover",
		time:4000 
	});
	
})

</script>

</head>

<body>
   <?php $this->load->view('head');?>
    <div class="w100p mb20">
    	<div class="w903 mg clearfix">
        	<div class="layout_left">
            	<!-- store -->
            	<div class="box_s5 mb12">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class=" store_lunbo">
                        	<ul class="s_lunbo" id="picUL">
                        		<?php foreach ($lunboList as $key=>$lunbo):?>
                        			<li <?php if($key == 0):?>class="current"<?php endif;?>>
                        			<a href="<?php echo $lunbo['link']?>" target="_blank"><img src="<?php echo site_url($lunbo['image'])?>" width="571" height="330" class="block" /></a>
                        			</li>
                        		<?php endforeach;?>
                            	
                            </ul>
                            <ul class="preview_box" id="sPicUL">
                            <?php foreach ($lunboList as $key=>$lunbo):?>
                            	<li><a href="<?php echo $lunbo['link']?>" target="_blank" class="block"><img src="<?php echo site_url($lunbo['image'])?>" width="110" height="65" class="block" /></a></li>
                            <?php endforeach;?>
                            </ul>
                            <ul class="lb_title" id="titleUL">
                            	<?php foreach ($lunboList as $key=>$lunbo):?>
                            	<li>
                                	<div class="transparent_bg"></div>
                                    <div class="tit_box">
                                    	<i class="icon_arrow_s1"></i><span><?php echo $lunbo['title']?></span>
                                    	<div class="clear"></div>    
                                    </div>
                                </li>
                                <?php endforeach;?>
                            </ul>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- store--end -->
                
                <!-- gz_store -->
                <div class="com_box_s1">
                	<h1>最受关注类型小店<span class="instruc">静安别墅</span></h1>
                    <ul class="hot_gz_store">
                    	<?php foreach ($hotstore as $key=>$store):?>
                    		<li <?php if(($key+1)%2 == 0):?>class="no_margin"<?php endif;?>>
	                        	<div class=" lr_box">
	                            	<div class="l_box">
	                                	<a href="<?php echo site_url('store?id='.$store['id'])?>"><img src="<?php echo site_url($store['photo'])?>" width="82" height="82" class="block" /></a>
	                                </div>
	                                <div class="r_box">
	                                	<p class="title">
	                                    	<a href="<?php echo site_url('store?id='.$store['id'])?>"><?php echo $store['name']?></a>
	                                    </p>
	                                    <p class="info">地址：<?php echo $store['address']?></p>
	                                    <div class="rela_nums">
	                                        <div class="love_nums" storeId="<?php echo $store['id']?>">
	                                            <i class="icon_heart"></i><span>喜欢<b><?php echo $store['loves']?></b></span>
	                                        </div>
	                                    </div>
	                                </div>
	                            </div>
	                        </li>
                    	<?php endforeach;?>
                    	
                       
                    </ul>
                    <div class="clear"></div>
                </div>
                <!-- gz_store--end-->
                
                <!-- hot_store_comment -->
                <div class=" com_box_s1">
                	<h1>热门小店评论</h1>
                    <ul class="comment_list lr_box mt15">
                    	<?php foreach ($hotcomment as $comment):?>
                    		 <li>
	                            <div class="l_box"><a href="<?php echo site_url('store?id='.$comment['storeid'])?>"><img src="<?php echo site_url($comment['storephoto'])?>" width="62" height="62" class="block" /></a></div>
	                            <div class="r_box">
	                                <p class="info">                                        	
	                                    <a href="#"><?php echo replaceExpress($comment['content'])?></a>
	                                </p>
	                                <div class="comment_else">
	                                    <div class="comment_nums">
	                                        <a href="###" commentId="<?php echo $comment['id']?>" onclick="support(this);"><span>支持 [<label class="sup_num"><?php echo $comment['support']?></label>]</span></a>
	                                        &nbsp;<a target="_blank" href="<?php echo site_url('replylist/'.$comment['id'].'/4')?>" class="c_reply"><span>回复 [<?php echo $comment['replys']?>]</span></a>
	                                    </div>
	                                    <span>来自：<a href="<?php echo site_url('tamember?id='.$comment['creatid'])?>" class="author"><?php echo $comment['creator']?></a>&nbsp;<?php echo date('Y-m-d',$comment['createtime'])?>  </span>
	                                </div>
	                            </div>
	                            <div class="clear"></div>
                            <!-- comment_frame -->
                            <div class="com_comment" style="display:none;">

                                <div class="main_comment">
                                    <ul class="face_box">
                                        <li express="[大笑]"><img src="../../images/others/face_1.png" /></li>
		                                <li express="[惊讶]"><img src="../../images/others/face_2.png" /></li>
		                                <li express="[害羞]"><img src="../../images/others/face_3.png" /></li>
		                                <li express="[哈切]"><img src="../../images/others/face_4.png" /></li>
		                                <li express="[白眼]"><img src="../../images/others/face_5.png" /></li>
		                                <li express="[大哭]"><img src="../../images/others/face_6.png" /></li>
		                                <li express="[偷笑]"><img src="../../images/others/face_7.png" /></li>
		                                <li express="[示爱]"><img src="../../images/others/face_8.png" /></li>
                                    </ul>
                                        <table class="com_form issue_comment">
                                            <tbody>
	                                            <tr>
	                                                <td><textarea class=" def_ta_s5" name="info"></textarea><br class="clear"><div class="validate_v" /></td>
	                                            </tr>
	                                            <tr>
	                                                <td class="tr"><input replyId="<?php echo $comment['id']?>" type="button" value="提交" class="def_btn_s9 mt5 submit reply_comment" /></td>
	                                            </tr>
                                        	</tbody>
                                        </table>
                                </div>
                            </div>
	                        </li>
                    	<?php endforeach;?>
                       
                     
                       
                    </ul>
                </div>
                <!-- hot_store_comment--end-->
                
                <!-- comment_frame -->
                
                <!-- comment_frame--end-->

                
            </div>
            
            <div class="layout_right">
            	
                <!-- notice -->
            	<div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                    	<div class="com_box_s4">
                        	<h1><div class="fr fy_box"><a href="#" class="mr15"><i class="icon_arrow_s3 "></i></a><a href="#"><i class="icon_arrow_s2"></i></a></div>最新小店</h1>
                            <ul class="new_store">
                            	<?php foreach ($lateststore as $store):?>
                            	<li>
                                	<div class=" lr_box">
                                        <div class="l_box">
                                            <a href="<?php echo site_url('store?id='.$store['id'])?>"><img src="<?php echo site_url($store['photo'])?>" width="62" height="62" class="block" /></a>
                                        </div>
                                        <div class="r_box">
                                            <p class="title">
                                                <a href="#"><?php echo $store['name']?></a>
                                            </p>
                                            <p class="info">地址：<?php echo $store['address']?></p>
                                            <div class="rela_nums">
                                                <div class="love_nums" storeId="<?php echo $store['id']?>">
                                                    <i class="icon_heart"></i><b style="font-weight: normal;"><?php echo $store['loves']?></b>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                            	<?php endforeach;?>
                            	
                            </ul>
                            <a href="###" id="add_store" class="def_btn_s15 add_btn_street">添加小店</a>
                        </div>
                    </div>
                    <div class="b_foot"></div>
                </div>
                <!-- notice--end-->
                
                <!-- store_sorts -->
                <div class="box_s6 mb15">
                	<div class="b_head"></div>
                    <div class="content">
                        <div class=" com_box_s1 mb20 store_sorts">
                            <h1><a href="#" class="more fr mr10">更多...</a>分类浏览</h1>
                            <div class="blank5"></div>
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_life fl"></i><span class="title_bg">生活</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                        <?php foreach ($shenghuo as $sh):?>
                                		<a href="<?php echo site_url('storelist/shenghuo/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                		<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_clothes fl"></i><span class="title_bg">服饰</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                        <?php foreach ($fushi as $sh):?>
                                		<a href="<?php echo site_url('storelist/fushi/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_culture fl"></i><span class="title_bg">文化</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                        <?php foreach ($wenhua as $sh):?>
                                		<a href="<?php echo site_url('storelist/wenhua/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                		<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_fun fl"></i><span class="title_bg">休闲</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                       <?php foreach ($xiuxian as $sh):?>
	                                		<a href="<?php echo site_url('storelist/xiuxian/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
	                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_food fl"></i><span class="title_bg">美食</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                       <?php foreach ($meishi as $sh):?>
                                		<a href="<?php echo site_url('storelist/meishi/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_brand fl"></i><span class="title_bg">原创品牌</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                       <?php foreach ($ycpp as $sh):?>
                                		<a href="<?php echo site_url('storelist/ycpp/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_area fl"></i><span class="title_bg">特色区域</span><div class="clear"></div>
                                </div>
                                <div class="lm_box">
                                    <div class="sorts_box link_box">
                                      <?php foreach ($tsqy as $sh):?>
                                		<a href="<?php echo site_url('storelist/tsqy/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_art fl"></i><span class="title_bg">艺术中心</span><div class="clear"></div>
                                </div>
                                 <div class="lm_box">
                                    <div class="sorts_box link_box">
                                      <?php foreach ($yishu as $sh):?>
                                		<a href="<?php echo site_url('storelist/yishu/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                	<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                            
                            <div class="sorts_item">
                                <div class="sorts_title">
                                	<i class="icon_subway fl"></i><span class="title_bg">地铁小店</span><div class="clear"></div>
                                </div>
                                 <div class="lm_box">
                                    <div class="sorts_box link_box">
                                      <?php foreach ($ditie as $sh):?>
                                		<a href="<?php echo site_url('storelist/ditie/'.$sh['code'])?>" target="_blank"><?php echo $sh['value']?></a>	
                                		<?php endforeach;?>
                                		<br class="clear" />
                                    </div>
                                    <div class="show_more fr"><a href="javascript:;">more</a></div>
                                    <div class="clear"></div>
                                </div>
                            </div>
                            
                        </div>
                	</div>
                    <div class="b_foot"></div>
                </div>
                <!-- store_sorts--end-->
                

                
            </div>
            
        </div>
    </div>
    
   <?php $this->load->view('foot')?>
</body>
<script type="text/javascript">
$(function(){

	$(".love_nums").css("cursor","pointer").click(function(){
		var obj = $(this);
		if(xiaodian.checkLogin()){
			$.post("<?php echo site_url('member/love')?>",{
				loveType:2,
				loveId:$(this).attr('storeId')
			},function(data){
					var ret = $.parseJSON(data);
					if(ret.success == 'true'){
						var loves = $(obj).find("b");
						loves.text(parseInt(loves.text())+1);	
					}else{
						alert(ret.msg);
					}
					
				});
		}else{
			window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('storemain')?>";
		}
		
	});
	
	$("#add_store").click(function(){
		if(xiaodian.checkLogin()){
			window.location.href="<?php echo site_url('member/addstore')?>";
		}else{
			window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('member/addstore')?>";
		}
	});

//	$.defaults.commentReply("<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('storemain')?>");

	$(".reply_comment").click(function(){
		
		var content = $(this).parent().parent().parent().find("textarea[name='info']").val();
		if(content == null || content ==''){
			alert('评论不能为空');
			return ;
		}

		$.post("<?php echo site_url('member/replycomment')?>",{
			type:3,
			belongId:$(this).attr('replyId'),
			content:content
		},function(data){
				var ret = $.parseJSON(data);
				if(ret.success == 'true'){
					window.location.reload();
				}else{
					alert(ret.msg);
				}
				
			});
	});
});

function support(obj){
	if(xiaodian.checkLogin()){
		$.post('<?php echo site_url('member/support')?>',{
				belongId:$(obj).attr('commentId'),
				type:'4'
			},function(data){
				var ret = $.parseJSON(data);
				if(ret.success=='true'){
					var oldNum = $(obj).find(".sup_num").text();
					$(obj).find(".sup_num").text(parseInt(oldNum)+1);
				}else{
					alert(ret.msg);
				}
			})
		
	}else{
		window.location.href="<?php echo site_url('member/tologin')?>?gourl=<?php echo site_url('storemain')?>";
	}
}
</script>
</html>
